Skip to content

Conversation

@erikburt
Copy link
Contributor

@erikburt erikburt commented Jun 19, 2025

Changes

Adds the UNIX time to the self-hosted runner label if it exists.

Motivation

We typically use runs-on=${{ github.run_id }}, but this templating doesn't work when the definition is in the YAML file. So right now we just have runs-on/....

We need to add a somewhat unique ID to this label otherwise you can experience cases where a runner that was launched for one job, is taken by another job, delaying one. This is a problem with our integration tests because we are spawning a lot of instances all at once and poaching runners can lead to delays


DX-1176


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes aim to enhance the test filtering capabilities and to introduce a new feature for dynamically modifying the RunsOnSelfHosted label based on the GitHub run ID or a timestamp, improving the traceability and specificity of test environments. This makes the CI tool more flexible and capable of handling a wider range of testing scenarios.

What

  • tools/citool/cmd/filter_cmd.go
    • Imported strconv and time packages to facilitate string to integer conversion and timestamp generation.
    • Added a new function processRunsOnSelfHosted that dynamically adjusts the RunsOnSelfHosted label with either the GitHub run ID or a current timestamp, enhancing specificity and traceability.
    • Modified the filterTests function to utilize processRunsOnSelfHosted, applying the new label modification logic to each filtered test configuration.
  • tools/citool/cmd/filter_cmd_test.go
    • Imported strings package to support string manipulation in tests.
    • Added TestRunsOnSelfHostedID to validate the behavior of the new processRunsOnSelfHosted function, ensuring it correctly modifies the RunsOnSelfHosted label under various conditions.

@erikburt erikburt self-assigned this Jun 19, 2025
@erikburt erikburt requested a review from a team as a code owner June 19, 2025 19:41
@erikburt erikburt enabled auto-merge (squash) June 23, 2025 21:07
@erikburt erikburt disabled auto-merge June 23, 2025 21:07
@erikburt erikburt enabled auto-merge (squash) June 23, 2025 21:07
@erikburt erikburt merged commit d12aaf9 into main Jun 23, 2025
62 checks passed
@erikburt erikburt deleted the chore/add-id-for-runs-on branch June 23, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants